﻿<UserControl x:Class="YourLastAboutDialog.Views.ApplicationInfoView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:common="clr-namespace:YourLastAboutDialog.Common" mc:Ignorable="d"
             FontFamily="{StaticResource PhoneFontFamilyNormal}"
             FontSize="{StaticResource PhoneFontSizeNormal}"
             Foreground="{StaticResource PhoneForegroundBrush}"
             d:DesignHeight="480"
             d:DesignWidth="480">   
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Content/About/AboutStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <common:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
        </ResourceDictionary>        
    </UserControl.Resources>

    <ScrollViewer HorizontalScrollBarVisibility="Disabled">
        <StackPanel Margin="0,-12,0,24">
            <TextBlock Style="{StaticResource AboutTextTitleStyle}"
                       Visibility="{Binding ApplicationTitle, Converter={StaticResource StringToVisibilityConverter}}"
                       Text="{Binding ApplicationTitle}" />

            <StackPanel Orientation="Horizontal"
                        Visibility="{Binding ApplicationAuthor, Converter={StaticResource StringToVisibilityConverter}}">
                <TextBlock Style="{StaticResource AboutTextSubTitleStyle}"
                           Margin="12 0 5 0"
                           Text="{Binding MainItemData.AppAuthorLabel}" />
                <TextBlock Style="{StaticResource AboutTextSubTitleStyle}"
                           Margin="0"
                           Text="{Binding ApplicationAuthor}" />
            </StackPanel>

            <StackPanel Orientation="Horizontal"
                        Visibility="{Binding ApplicationPublisher, Converter={StaticResource StringToVisibilityConverter}}"
                        Margin="0 18 0 0">
                <TextBlock Style="{StaticResource AboutTextNormalStyle}"
                           Margin="12 0 5 0"
                           Text="{Binding MainItemData.AppPublisherLabel}" />
                <TextBlock Style="{StaticResource AboutTextNormalStyle}"
                           Margin="0"
                           Text="{Binding ApplicationPublisher}" />
            </StackPanel>

            <Grid Margin="0"
                  Visibility="{Binding ApplicationDescription, Converter={StaticResource StringToVisibilityConverter}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <TextBlock Style="{StaticResource AboutTextNormalStyle}"
                           Margin="12 0 5 0"
                           Text="{Binding MainItemData.AppDescriptionLabel}" />
                <TextBlock Grid.Column="1"
                           Style="{StaticResource AboutTextNormalStyle}"
                           Margin="0"
                           Text="{Binding ApplicationDescription}"
                           TextWrapping="Wrap" />
            </Grid>

            <StackPanel Orientation="Horizontal"
                        Visibility="{Binding ApplicationVersion, Converter={StaticResource StringToVisibilityConverter}}"
                        Margin="0">
                <TextBlock Style="{StaticResource AboutTextNormalStyle}"
                           Margin="12 0 5 0"
                           Text="{Binding MainItemData.AppVersionLabel}" />
                <TextBlock Style="{StaticResource AboutTextNormalHighlightedStyle}"
                           Margin="0"
                           Text="{Binding ApplicationVersion}" />
            </StackPanel>

            <ItemsControl ItemsSource="{Binding Links}"
                          Margin="0 5 0 15">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal"
                                    Margin="0 0 0 0">
                            <TextBlock Text="{Binding Label}"
                                       Style="{StaticResource AboutTextNormalStyle}"
                                       VerticalAlignment="Center" />
                            <HyperlinkButton NavigateUri="{Binding NavigateUri}"
                                             TargetName="_blank"
                                             HorizontalAlignment="Left"
                                             Margin="-15 0 0 0"
                                             Padding="0"
                                             Style="{StaticResource AboutHyperlinkButtonStyle}"
                                             Content="{Binding Content}" />
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

            <Button HorizontalAlignment="Center"
                    Style="{StaticResource AboutButtonStyle}"
                    Visibility="{Binding MainItemData.AppReviewButtonContent, Converter={StaticResource StringToVisibilityConverter}}"
                    Margin="0 0 0 0"
                    Tag="Review"
                    Content="{Binding MainItemData.AppReviewButtonContent}"
                    Command="{Binding ReviewCommand}" />

            <Button HorizontalAlignment="Center"
                    Style="{StaticResource AboutButtonStyle}"
                    Visibility="{Binding BuyOptionVisibility}"
                    Margin="0 0 0 0"
                    Tag="Buy"
                    Content="{Binding MainItemData.AppBuyButtonContent}"
                    Command="{Binding BuyCommand}" />

            <TextBlock Style="{StaticResource AboutTextNormalStyle}"
                       Visibility="{Binding AdditionalNotes, Converter={StaticResource StringToVisibilityConverter}}"
                       Margin="12 15 5 0"
                       Text="{Binding MainItemData.AppAdditionalNotesLabel}" />
            <TextBlock Style="{StaticResource AboutTextNormalStyle}"
                       Visibility="{Binding AdditionalNotes, Converter={StaticResource StringToVisibilityConverter}}"
                       Margin="12 0 0 0"
                       TextWrapping="Wrap"
                       Text="{Binding AdditionalNotes}" />
        </StackPanel>
    </ScrollViewer>
</UserControl>
